import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import NotFound from '../views/NotFound.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
    },
    {
      path: '/:pathMatch(.*)*',
      name: 'notFound',
      component: NotFound,
    },
    {
      // 若url为六个数字则跳转到about页面
      path: '/:id(\\d{6})',
      name: 'about',
      component: () => import('../views/AboutView.vue')
    }
  ],
})

export default router
